<template>
  <div class="main-container">
    <div class="first">

    </div>

  </div>
</template>
<script>
import Page from '@/components/common/Page.vue'
export default {
  name: 'workspace',
  components: {
    Page
  },
  data () {
    return {
    }
  },

  created() {
    //this.websocketEvent()
  },
  methods: {
    websocketEvent() {
      let ws = new WebSocket("ws://127.0.0.1:8282"); //192.168.10.168

      // 服务端主动推送消息时会触发这里的onmessage
      ws.onmessage = function(e){
        // json数据转换成js对象
        var data = eval("("+e.data+")");
        var type = data.type || '';
        switch(type){
            // Events.php中返回的init类型的消息，将client_id发给后台进行uid绑定
          case 'init':
            console.log(data)
            break;
            // 当mvc框架调用GatewayClient发消息时直接alert出来
          default :
            alert(e.data);
        }
      };
    }
  },
  mounted () {
  },
};
</script>
<style scoped  lang="scss">

.pagination {
  justify-content: flex-end;
}
.el-badge {
  margin:10px 0 0 20px;
}
.main-container {
  width: 100%;
  height: 100%;
  .notice {
    width: 99%;
    line-height: 24px;
    border: 0px solid #ccc;
    border-radius: 5px;
    margin-left: 10px;
    font-size: 14px;
    cursor: pointer;
    .tip {
      color:#F56C6C;
    }
    .action {
      color:#409EFF;
    }
  }
  .first {
    width: 100%;
    border:0px solid #ff0000;
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 0 0;
    .item {
      //width: 33%;
      height: 360px;
      overflow:hidden;
      background: #fff;
      border-radius: 5px;
      border: 0px solid #000;
      margin-left: 10px;
      font-size: 14px;
      .title {
        width: 96%;
        line-height: 38px;
        border-bottom: 1px solid #f3f3f3;
        margin-left: 16px;
        display:flex;
        justify-content: space-between;
        font-weight: bold;
        .name {
          font-weight: bold;
        }
        .save_time {
          color:#BBBBBB;
          font-size: 12px;
          margin-right: 5px;
        }
      }
      .nav {
        display: flex;
        width: 100%;
        line-height: 46px;
        .list {
          width: 25%;
          text-align: left;
          margin-left: 10px;
        }
        .active {
          color:#409EFF;
        }
      }
      .data_item_box {
        width: 100%;
        .name {
          line-height: 34px;
          margin-left: 16px;
          font-size: 13px;
          font-weight: bold;
        }
        .block {
          display: flex;
          flex-wrap: wrap;
          align-items: center; /* 垂直居中 */
          .data_item_list {
            width: 24%;
            height: 60px;
            border: 0px solid #ff0000;
            margin-right: 2px;
            text-align: center;
            .value {
              margin-top: 6px;
              font-size: 18px;
              //font-weight: bold;
              color:#F56C6C;
              .icon {
                font-size: 12px;
              }
            }
            .item_name {
              font-size: 14px;
              color:#A4ADB3;
              margin-top: 10px;
            }

          }
        }

      }

      .data {
        width: 100%;
        border: 0px solid #ff0000;
        height: 320px;
        overflow-y: auto;
        font-size: 14px;
        .data_header {
          line-height: 28px;
          background: #eef1f6;
          border-radius: 5px;
          width: 96%;
          margin: 10px auto 0;
          display: flex;
          color:#606266;
          .header_list {
            width:calc(100% / 4);
            text-align: center;
          }
        }
        .data_box {
          width: 96%;
          margin: 0 auto;
          .data_list {
            display: flex;
            //line-height: 34px;
            height: 36px;
            align-items: center;
            border-bottom: 1px solid #f3f3f3;
            //padding: 12px 0 12px 0;
            .field {
              width:calc(100% / 4);
              text-align: center;
              color:#333333;
            }
            .field:last-child {
              color:#409EFF;
              cursor: pointer;
            }
          }
        }
      }
      .menu {
        overflow-y: auto;
        height: 270px;
        border:0px solid #ff0000;
        .name {
          line-height: 14px;
          margin: 16px 0 4px 16px;
          font-size: 14px;
          border-left: 2px solid #409EFF;
          padding-left: 5px;
          font-weight: bold;
        }
        .menu_box {
          width: 94%;
          margin: 0 auto;
          border: 0px solid #000;
          display: flex;
          flex-wrap: wrap;
          .menu_box_list {
            cursor: pointer;
            width: 20%;
            height: 50px;
            border:0px solid #ccc;
            text-align: center;
            margin: 10px 0 0px 0;
            font-size: 14px;
            .icon {
              width: 24px;
              height: 24px;
              margin: 0 auto 8px;
            }
          }
        }
      }

    }
    .width40 {
      width: 67%;
    }
    .width3 {
      width: 33%;
    }
  }
}
</style>